import api from "@/util/service";

const userApi = {
  async findAllUsers(user: any) {
    const res = await api.post("/userinfo/selectUser", user);
    return res;
  },
  // 添加用户方法
  addUser: (user: any) => {
    return api.post('/userinfo/insertUser', user);
  },
  // 删除用户方法
  deleteUser: (user: any) => {
    return api.post('/userinfo/delete', user);
  },
  // 修改用户方法
  updateUser: (user: any) => {
    return api.post('/userinfo/updata', user);
  },

  //查询所有的角色
  getAllRole: () => {
    return api.get('/roles/select');
  },
  //修改用户角色
  updateUserRole: (user: any) => {
    return api.post('/roles/putroles', user);
  }
  };

export default userApi;